using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GUI_script : MonoBehaviour
{
    public float size_factor=1.0f;
    public GUISkin customSkin_1;
    public GUISkin customSkin_1_r;
    public GUISkin customSkin_2;
    void OnGUI ()
    {
        GUI.skin=(main_script.now_who==1)?customSkin_1:customSkin_1_r;
        GUI.BeginGroup (new Rect (Screen.width / 2-335, Screen.height / 2-335, 670, 670));
        if(main_script.remake_flag==false)
        for(int i=0;i<3;++i)
        for(int j=0;j<3;++j){
            if(GUI.Button (new Rect (0+j*230,0+i*230,200*size_factor,200*size_factor), "")){
                main_script.put(i*3+j,main_script.now_who);
            }  
        }
        GUI.skin=customSkin_2;
        if(main_script.remake_flag==true)
            if(GUI.Button (new Rect (0,0,670,670), main_script.ifwin_msg+"\n"+"重新开始"))
                main_script.remake(0);
        GUI.EndGroup ();
        if(GUI.Button (new Rect (0,0,185,85), "当前"+ ((main_script.mode_flag)?"人机":"人人") +"\n切换模式"))
            main_script.remake(1);
        GUI.Label(new Rect(0,400,185,40),"红蓝比分\n");
        GUI.Label(new Rect(0,440,185,40),(main_script.game_score[0]).ToString()+" : "+ (main_script.game_score[1]).ToString());
       
    }

}